SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[_PrescriptionDetail_GetReport]
@FromDate DATETIME,@ToDate DATETIME
AS
SELECT  Prescription.PrescriptionID ,
        PrescriptionDetail.DrugId ,
        Prescription.DeliveryDate ,
        Prescription.PatientCode ,
        Prescription.PatientName ,
        PrescriptionDetail.DrugName ,
        PrescriptionDetail.Unit ,
        PrescriptionDetail.Quantity ,
        PrescriptionDetail.CostPrice ,
        PrescriptionDetail.UnitPrice ,
        PrescriptionDetail.ExpDate ,
        PrescriptionDetail.BatchLot ,
        PrescriptionDetail.Remark
FROM    PrescriptionDetail
        INNER JOIN Prescription ON PrescriptionDetail.PrescriptionID = Prescription.PrescriptionID
WHERE   ( Prescription.IsVoid = 0 ) AND CreateDate BETWEEN @FromDate AND @ToDate
GO
